package com.fumasoft.dynamic.config;

import com.aliyun.openservices.ons.api.PropertyKeyConst;
import java.util.Properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * RocketMQ配置.
 *
 * @Author: jingchen
 * @Date: 2025/08/30
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "rocketmq")
public class RocketMqConfig {

    private String accessKey;

    private String secretKey;

    private String nameSrvAddr;

    private String billTopic;

    private String billGroup;

    private String billTag;

    /**
     * 获取RocketMQ配置属性.
     *
     * @return 属性
     */
    public Properties getMqProperties() {
        Properties properties = new Properties();
        properties.setProperty(PropertyKeyConst.AccessKey, accessKey);
        properties.setProperty(PropertyKeyConst.SecretKey, secretKey);
        properties.setProperty(PropertyKeyConst.NAMESRV_ADDR, nameSrvAddr);
        return properties;
    }

}
